import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";

const history = createWebHistory();

const routes: Array<RouteRecordRaw> = [
    {
        path: "/",
        name: "home",
        component: () => import("@/views/home.vue"),
        redirect: "/login",
        children: [
            {
                path: "/devices",
                name: "devices",
                component: () => import("@/views/pages/devices.vue")
            },
            {
                path: "/chat",
                name: "chat",
                component: () => import("@/views/pages/chat.vue")
            }
        ]
    },
    {
        path: "/login",
        name: "login",
        component: () => import("@/views/login.vue")
    }
];

const router = createRouter({
    history,
    routes
});
export default router;
